﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;

public partial class reports_userControls_MTD_Chart : System.Web.UI.UserControl
{
    public HtmlTable TblChart
    {
        get { return tblChart; }
    }

    public HtmlTableCell TdChart
    {
        get { return tdChart; }
    }

    public HtmlTableCell TdTitle
    {
        get { return tdTitle; }
    }

    string _Title;
    public string Title
    {
        get { return _Title; }
        set { _Title = value; }
    }

    string _Plan;
    public string Plan
    {
        get { return _Plan; }
        set { _Plan = value; }
    }

    string _Color;
    public string Color
    {
        get { return _Color; }
        set { _Color = value; }
    }

    int _MTD_CNT, _PREV_MTD_CNT, _PREV_MON, _PACING_CNT, _MAX_CNT;
    public int MAX_CNT
    {
        get { return _MAX_CNT; }
        set { _MAX_CNT = value; }
    }

    public int PACING_CNT
    {
        get { return _PACING_CNT; }
        set { _PACING_CNT = value; }
    }

    public int PREV_MON
    {
        get { return _PREV_MON; }
        set { _PREV_MON = value; }
    }

    public int PREV_MTD_CNT
    {
        get { return _PREV_MTD_CNT; }
        set { _PREV_MTD_CNT = value; }
    }

    public int MTD_CNT
    {
        get { return _MTD_CNT; }
        set { _MTD_CNT = value; }
    }

    decimal _PACE_RATE;
    public decimal PACE_RATE
    {
        get { return _PACE_RATE; }
        set { _PACE_RATE = value; }
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        lblChart.Text = Title;
        if (Plan == "SUBTOTAL")
            imgChart.ImageUrl = string.Format("http://chart.apis.google.com/chart?cht=bhg&chco={0}&chbh=a&chm=N,000000,0,-1,11&chxt=y&chs=150x80&chxl=0:|PACING|PREV+MON|PREV+MTD|MTD&chd=t:{1},{2},{3},{4}&chds=0,{5}&chtt={6}&chts={0},12", Color, MTD_CNT, PREV_MTD_CNT, PREV_MON, PACING_CNT, MAX_CNT, PACE_RATE);
        else
            imgChart.ImageUrl = string.Format("http://chart.apis.google.com/chart?cht=bhg&chco={0}&chbh=a&chm=N,000000,0,-1,11&chxt=y&chs=100x80&chxl=0:|*|*|*|MTD&chd=t:{1},{2},{3},{4}&chds=0,{5}&chtt={6}&chts={0},12", Color, MTD_CNT, PREV_MTD_CNT, PREV_MON, PACING_CNT, MAX_CNT, PACE_RATE);  
    }
}